home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Minami 58
/
MINAMI58.ISO
/
Varios
/
Juegos Flash
/
Gold Yard.exe
/
scripts
/
DefineSprite_609
/
frame_4
/
DoAction.as
Wrap
Text File
|
2003-04-29
|
2KB
|
51 lines
var Xmonster = Number(int(getProperty("_root.enemy" add depth, _X)));
var Ymonster = Number(int(getProperty("_root.enemy" add depth, _Y)));
var Xdroid = Number(int(getProperty("_root.droid" add _root.library.depth, _X)));
var Ydroid = Number(int(getProperty("_root.droid" add _root.library.depth, _Y)));
if(Xdroid < Xmonster)
{
EXmove = - Xincr;
}
else if(Xmonster < Xdroid)
{
EXmove = Xincr;
}
else if(Xmonster == Xdroid)
{
EXmove = 0;
}
if(Ydroid < Ymonster)
{
EYmove = - Yincr;
}
else if(Ymonster < Ydroid)
{
EYmove = Yincr;
}
else if(Ymonster == Ydroid)
{
EYmove = 0;
}
setProperty("_root.enemy" add depth, _X, getProperty("_root.enemy" add depth, _X) + EXmove);
setProperty("_root.enemy" add depth, _Y, getProperty("_root.enemy" add depth, _Y) + EYmove);
newdepth = Number(int((getProperty("_root.enemy" add depth, _Y) - _root.library.planey) / _root.library.planecelly));
if(Number(newdepth) != Number(depth))
{
if(Number(newdepth) < 1)
{
newdepth = 1;
}
setProperty("_root.enemy" add depth, _visible, 0);
setProperty("_root.enemy" add newdepth, _X, getProperty("_root.enemy" add depth, _X));
setProperty("_root.enemy" add newdepth, _Y, getProperty("_root.enemy" add depth, _Y));
setProperty("/enemy" add newdepth, _visible, 1);
depth = newdepth;
_root.bigghostfx.gotoAndPlay("on");
}
deltax = Number(getProperty("_root.enemy" add depth, _X)) - Number(getProperty("_root.droid" add _root.library.depth, _X));
deltay = Number(getProperty("_root.enemy" add depth, _Y)) - Number(getProperty("_root.droid" add _root.library.depth, _Y));
if(Number(math.abs(deltax)) < 15 and Number(math.abs(deltay)) < 15)
{
_root.library.drain(_root.library.damage_ghost);
}